using System;
using System.ComponentModel;
using System.Runtime.Serialization;

namespace WcfService1.DTO
{
    [DataContract]
    public class JurnalConfigDTO : INotifyPropertyChanged
    {
        private bool _Debit;
        private Int32 _JurnalConfigId;


        private String _JurnalType;
        private bool _Kredit;
        private int _No;


        private String _Property;
        private String _created_by;
        private DateTime? _created_date;
        private String _modified_by;
        private DateTime? _modified_date;
        private string _AccountNumber;

        [DataMember]
        public Int32 JurnalConfigId
        {
            get { return _JurnalConfigId; }
            set
            {
                _JurnalConfigId = value;
                RaisePropertyChanged("JurnalConfigId");
            }
        }

        [DataMember]
        public String JurnalType
        {
            get { return _JurnalType; }
            set
            {
                _JurnalType = value;
                RaisePropertyChanged("JurnalType");
            }
        }

        [DataMember]
        public String Property
        {
            get { return _Property; }
            set
            {
                _Property = value;
                RaisePropertyChanged("Property");
            }
        }


        [DataMember]
        public string AccountNumber
        {
            get { return _AccountNumber; }
            set
            {
                _AccountNumber = value;
                RaisePropertyChanged("AccountNumber");
            }
        }


        [DataMember]
        public bool IsDebit
        {
            get { return _Debit; }
            set
            {
                _Debit = value;
                RaisePropertyChanged("Debit");
                if (value == true)
                    IsKredit = false;
                else
                    IsKredit = true;
            }
        }


        [DataMember]
        public bool IsKredit
        {
            get { return _Kredit; }
            set
            {
                _Kredit = value;
                RaisePropertyChanged("Kredit");
            }
        }


        [DataMember]
        public String created_by
        {
            get { return _created_by; }
            set
            {
                _created_by = value;
                RaisePropertyChanged("created_by");
            }
        }


        [DataMember]
        public DateTime? created_date
        {
            get { return _created_date; }
            set
            {
                _created_date = value;
                RaisePropertyChanged("created_date");
            }
        }

        [DataMember]
        public String modified_by
        {
            get { return _modified_by; }
            set
            {
                _modified_by = value;
                RaisePropertyChanged("modified_by");
            }
        }


        [DataMember]
        public DateTime? modified_date
        {
            get { return _modified_date; }
            set
            {
                _modified_date = value;
                RaisePropertyChanged("modified_date");
            }
        }

        public int No
        {
            get { return _No; }
            set
            {
                _No = value;
                RaisePropertyChanged("No");
            }
        }

        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

        protected void RaisePropertyChanged(string propertyname)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
                handler(this, new PropertyChangedEventArgs(propertyname));
        }
    }
}